﻿@using Microsoft.AspNetCore.Mvc.Localization
@using Skoruba.IdentityServer4.Admin.UI.Configuration.Constants
@model Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration.ClientCloneDto
@inject IViewLocalizer Localizer

@{
	ViewBag.Title = Localizer["PageTitle"];
	Layout = "_Layout";
}

<div class="row">
	<div class="col-12">
		<nav aria-label="breadcrumb">
			<ol class="breadcrumb">
				<li class="breadcrumb-item"><a asp-area="@CommonConsts.AdminUIArea" asp-controller="Configuration" asp-action="Clients">@Localizer["NavigationClients"]</a></li>
				<li class="breadcrumb-item"><a asp-area="@CommonConsts.AdminUIArea" asp-controller="Configuration" asp-action="Client" asp-route-id="@Model.Id">@Model.ClientIdOriginal</a></li>
				<li class="breadcrumb-item active" aria-current="page">@Localizer["PageTitle"]</li>
			</ol>
		</nav>
	</div>

	<div class="col-12">
		<h2>@Localizer["PageTitle"] - @Model.ClientIdOriginal (@Model.ClientNameOriginal)</h2>
	</div>
</div>

<form asp-area="@CommonConsts.AdminUIArea" id="client-form" asp-controller="Configuration" asp-action="ClientClone" Method="post">

	<div asp-validation-summary="All" class="text-danger"></div>

	<div class="card mt-3">
		<h5 class="card-header">@Localizer["PanelTitle"]</h5>
		<div class="card-body">
			<input type="hidden" asp-for="Id" />

			<!--Label-->
			<div class="form-group row">
				<div class="col-md-12">
					<div class="alert alert-warning" role="alert">
						<span class="sr-only">@Localizer["InfoTitle"]</span>
						@Localizer["InfoDescription"]
					</div>
				</div>
			</div>

			<!--Input - text -->
			<div class="form-group row">
				<label asp-for="ClientId" class="col-sm-3 col-form-label">
					@await Html.PartialAsync("Client/Section/Label", "ClientId")
				</label>
				<div class="col-sm-9">
					<input type="text" required class="form-control" asp-for="ClientId">
					<span asp-validation-for="ClientId" class="text-danger"></span>
				</div>
			</div>

			<!--Input - text -->
			<div class="form-group row">
				<label asp-for="ClientName" class="col-sm-3 col-form-label">
					@await Html.PartialAsync("Client/Section/Label", "ClientName")
				</label>
				<div class="col-sm-9">
					<input type="text" required class="form-control" asp-for="ClientName">
					<span asp-validation-for="ClientName" class="text-danger"></span>
				</div>
			</div>

			<!--Checkbox-->
			<div class="form-group row">
				<label asp-for="CloneClientGrantTypes" class="col-sm-3 col-form-label">
					@Localizer["LabelCloneClientGrantTypes"]
				</label>
				<div class="col-sm-9">
					<toggle-button>
						<input asp-for="CloneClientGrantTypes" type="checkbox">
					</toggle-button>
				</div>
			</div>

			<!--Checkbox-->
			<div class="form-group row">
				<label asp-for="CloneClientRedirectUris" class="col-sm-3 col-form-label">
					@Localizer["LabelCloneClientRedirectUris"]
				</label>
				<div class="col-sm-9">
					<toggle-button>
						<input asp-for="CloneClientRedirectUris" type="checkbox">
					</toggle-button>
				</div>
			</div>

			<!--Checkbox-->
			<div class="form-group row">
				<label asp-for="CloneClientScopes" class="col-sm-3 col-form-label">
					@Localizer["LabelCloneClientScopes"]
				</label>
				<div class="col-sm-9">
					<toggle-button>
						<input asp-for="CloneClientScopes" type="checkbox">
					</toggle-button>
				</div>
			</div>

			<!--Checkbox-->
			<div class="form-group row">
				<label asp-for="CloneClientClaims" class="col-sm-3 col-form-label">
					@Localizer["LabelCloneClientClaims"]
				</label>
				<div class="col-sm-9">
					<toggle-button>
						<input asp-for="CloneClientClaims" type="checkbox">
					</toggle-button>
				</div>
			</div>

			<!--Checkbox-->
			<div class="form-group row">
				<label asp-for="CloneClientCorsOrigins" class="col-sm-3 col-form-label">
					@Localizer["LabelCloneClientCorsOrigins"]
				</label>
				<div class="col-sm-9">
					<toggle-button>
						<input asp-for="CloneClientCorsOrigins" type="checkbox">
					</toggle-button>
				</div>
			</div>

			<!--Checkbox-->
			<div class="form-group row">
				<label asp-for="CloneClientPostLogoutRedirectUris" class="col-sm-3 col-form-label">
					@Localizer["LabelCloneClientPostLogoutRedirectUris"]
				</label>
				<div class="col-sm-9">
					<toggle-button>
						<input asp-for="CloneClientPostLogoutRedirectUris" type="checkbox">
					</toggle-button>
				</div>
			</div>

			<!--Checkbox-->
			<div class="form-group row">
				<label asp-for="CloneClientIdPRestrictions" class="col-sm-3 col-form-label">
					@Localizer["LabelCloneClientIdPRestrictions"]
				</label>
				<div class="col-sm-9">
					<toggle-button>
						<input asp-for="CloneClientIdPRestrictions" type="checkbox">
					</toggle-button>
				</div>
			</div>

			<!--Checkbox-->
			<div class="form-group row">
				<label asp-for="CloneClientProperties" class="col-sm-3 col-form-label">
					@Localizer["LabelCloneClientProperties"]
				</label>
				<div class="col-sm-9">
					<toggle-button>
						<input asp-for="CloneClientProperties" type="checkbox">
					</toggle-button>
				</div>
			</div>

			<!--Button-->
			<div class="form-group row">
				<label class="col-sm-3 col-form-label">
				</label>
				<div class="col-sm-9">
					<button type="submit" class="btn btn-primary">@Localizer["ButtonClone"]</button>
				</div>
			</div>
		</div>
	</div>
</form>
